package is.ejs.bahamut;

import java.util.Map;

import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.Toast;

public class DiceTypeListener implements OnItemSelectedListener {
	private int idOfLine;
	private Map<Integer, Integer> typeMap;

    public DiceTypeListener(int targetId, Map<Integer, Integer> targetTypeMap) {
		idOfLine = targetId;
		typeMap = targetTypeMap;
	}

	public void onItemSelected(AdapterView<?> parent,
        View view, int pos, long id) {
    	int type = Integer.parseInt(parent.getItemAtPosition(pos).toString());
    	typeMap.put(idOfLine, type);
    }

    public void onNothingSelected(AdapterView parent) {
      // Do nothing.
    }
}
